document.getElementById('search').addEventListener('click', () => {
  const keyword = document.getElementById('keyword').value.trim();
  if (keyword) {
    chrome.runtime.sendMessage({
      action: 'search',
      keyword: keyword
    });
    window.close();
  } else {
    alert('请输入搜索关键词');
  }
});

